package cdp.tarasenko.epamevospring.model;

/**
 * @author Oleksandr_Tarasenko
 */

public class CityDataBean {

    private String cityName;
    private int employeesNumber;
    private double latitude;
    private double longitude;

    public String getCityName() {
        return cityName;
    }

    public int getEmployeesNumber() {
        return employeesNumber;
    }

    public double getLatitude() {
        return latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public void setEmployeesNumber(int employeesNumber) {
        this.employeesNumber = employeesNumber;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public CityDataBean(String cityName, int employeesNumber, double latitude, double longitude) {
        this.cityName = cityName;
        this.employeesNumber = employeesNumber;
        this.latitude = latitude;
        this.longitude = longitude;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CityDataBean that = (CityDataBean) o;

        if (employeesNumber != that.employeesNumber) return false;
        if (Double.compare(that.latitude, latitude) != 0) return false;
        if (Double.compare(that.longitude, longitude) != 0) return false;
        if (cityName != null ? !cityName.equals(that.cityName) : that.cityName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = cityName != null ? cityName.hashCode() : 0;
        result = 31 * result + employeesNumber;
        temp = Double.doubleToLongBits(latitude);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        temp = Double.doubleToLongBits(longitude);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }
}
